<template>
  <el-form class="state" label-width="120px" size="small">
    <el-form-item label="昵称">
      <div class="text">{{ $store.getters['user/accountInfo'].nick_name }}</div>
    </el-form-item>
    <el-form-item label="认证状态">
      <div class="text" :class="className[data.auth_status]">
        {{ data.auth_status_text }}
      </div>
    </el-form-item>
    <!-- <el-form-item label="所属机构">
      <div class="text">{{data.auth_info.school_name}}</div>
    </el-form-item> -->
    <el-form-item label="所属行业">
      <span class="text" v-for="(item, index) in data.auth_info.selected_category" :key="index">{{
        item.text
      }}</span>
    </el-form-item>
    <el-form-item label="身份证号">
      <div class="text">{{ data.auth_info.IDcard }}</div>
    </el-form-item>
    <el-form-item label="身份证正面">
      <edu-image
        class="preview"
        :src="data.auth_info.IDcard_positive_url"
        :preview-src-list="srcList"
      ></edu-image>
    </el-form-item>
    <el-form-item label="身份证反面">
      <edu-image
        class="preview"
        :src="data.auth_info.IDcard_side_url"
        :preview-src-list="srcList"
      ></edu-image>
    </el-form-item>
    <el-form-item label="教师资格证">
      <edu-image
        class="preview"
        :src="data.auth_info.certification_url"
        :preview-src-list="srcList"
      ></edu-image>
    </el-form-item>
    <template v-if="data.auth_info.status == 3">
      <el-divider></el-divider>
      <el-form-item>
        <el-button type="primary" @click="next">重新提交</el-button>
      </el-form-item>
    </template>
  </el-form>
</template>

<script>
export default {
  props: ['data'],
  data() {
    return {
      className: ['failure', 'success', 'failure', 'error', 'import']
    }
  },
  computed: {
    srcList() {
      return [
        this.data.auth_info.IDcard_positive_url,
        this.data.auth_info.IDcard_side_url,
        this.data.auth_info.certification_url
      ]
    }
  },
  methods: {
    next() {
      this.$emit('again', 5)
    }
  }
}
</script>

<style lang="scss" scoped>
.state {
  ::v-deep .el-form-item__label {
    font-size: 12px;
  }
  ::v-deep .el-icon-circle-close {
    color: #fff;
  }
  .text {
    font-size: 13px;
  }
  .import {
    color: $text-color-import;
  }
  .error {
    color: $text-color-error;
  }
  .failure {
    color: $text-color-auxiliary;
  }
  .success {
    color: $color-success;
  }
  .preview {
    width: 100px;
    height: 100px;
    display: block;
    margin-top: 10px;
  }
}
</style>
